//
//  DYEssenceViewController.m
//  BaiSi
//
//  Created by mac on 16/10/14.
//  Copyright © 2016年 DeYi. All rights reserved.
//

#import "DYEssenceViewController.h"
#import "DYAllViewController.h"
#import "DYVideoViewController.h"
#import "DYVoiceTableViewController.h"
#import "DYPhotoViewController.h"
#import "DYTextViewController.h"

@interface DYEssenceViewController ()


@end
@implementation DYEssenceViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    //设置导航栏
    [self setUpNavigationItemButton];
    
    //添加子控制器
    [self addChiledTitleViewcontrollers];
    
    
}

#pragma mark -设置导航栏按钮
- (void)setUpNavigationItemButton {
    //左边
    self.navigationItem.leftBarButtonItem = [UIBarButtonItem itemWithImage:[UIImage imageNamed:@"nav_item_game_icon"] highImage:[UIImage imageNamed:@"nav_item_game_click_icon"] target:self action:@selector(game)];
    
    //右边
    self.navigationItem.rightBarButtonItem = [UIBarButtonItem itemWithImage:[UIImage imageNamed:@"navigationButtonRandom"] highImage:[UIImage imageNamed:@"navigationButtonRandomClick"] target:self action:nil];
    
    //中间
    self.navigationItem.titleView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"MainTitle"]];
}

#pragma mark - 导航栏点击事件
- (void)game {
    LHLog(@"点击游戏");
}

#pragma mark - 添加子控制器
- (void)addChiledTitleViewcontrollers {
    //全部
    DYAllViewController *allVc = [[DYAllViewController alloc] init];
    allVc.view.frame = [UIScreen mainScreen].bounds;
    allVc.title = @"全部";
    [self addChildViewController:allVc];
    
    //视频
    DYVideoViewController *videoVc = [[DYVideoViewController alloc] init];
    videoVc.view.frame = [UIScreen mainScreen].bounds;
    videoVc.title = @"视频";
    [self addChildViewController:videoVc];
    
    //声音
    DYVoiceTableViewController *voiceVc = [[DYVoiceTableViewController alloc] init];
    voiceVc.view.frame = [UIScreen mainScreen].bounds;
    voiceVc.title = @"声音";
    [self addChildViewController:voiceVc];
    
    //图片
    DYPhotoViewController *photoVc = [[DYPhotoViewController alloc] init];
    photoVc.view.frame = [UIScreen mainScreen].bounds;
    photoVc.title = @"图片";
    [self addChildViewController:photoVc];
    
    //段子
    DYTextViewController *textVc = [[DYTextViewController alloc] init];
    textVc.view.frame = [UIScreen mainScreen].bounds;
    textVc.title = @"段子";
    [self addChildViewController:textVc];
    
}

@end
